package com.yuyang.gulimall.order.fegin;

import com.yuyang.common.utils.R;
import com.yuyang.gulimall.order.vo.WareSkuLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author yu yang
 * @date 2023/2/4 -20:26
 */
@FeignClient("gulimall-ware")
public interface WareFeignService {
    @PostMapping("/ware/waresku/hasStock")
    R hasStockBySkuIds(@RequestBody List<Long> skuIds);

    @GetMapping("ware/wareinfo/fare")
    R getFare(@RequestParam("addrId")Long addrId);

    @PostMapping("ware/waresku/lock/order")
    R skuWareLock(@RequestBody WareSkuLockVo wareSkuLockVo);

    @PostMapping("ware/waresku/reduce/stock")
    R reduceStock(@RequestBody String orderSn);

}
